<?php

/**
 * 报价记录
 */

namespace App\Models\MainDB\Auction;

use App\Traits\BelongsToUserData;
use App\Traits\BelongsToUserRoom;
use Illuminate\Database\Eloquent\Model;

class AuctionLog extends Model
{
    use BelongsToUserRoom;
    protected $table = 'ln_auction_log';

    protected $fillable = [
        'room_id',
        'room_name',
        'auction_user_id',
        'auction_user_name',
        'participation_user_id',
        'participation_user_name',
        'auction_officer_user_id',
        'auction_officer_user_name',
        'auction_content_id',
        'auction_content_type',
        'auction_content',
        'auction_content_timeliness_id',
        'auction_content_timeliness',
        'expired_time',
        'auction_gift_id',
        'auction_gift_name',
        'auction_gift_price',
        'auction_gift_picture',
        'auction_result_number',
        'total_price',
        'auction_result',
        'unsuccessful_reason'
    ];

    public $timestamps = false;

    public function auction()
    {
        return $this->belongsTo('App\Models\MainDB\Auction\Auction', 'auction_id', 'id');
    }

    public function auction_user_data()
    {
        return $this->belongsTo('App\Models\MainDB\UserData', 'auction_user_id', 'user_id');
    }
    public function participation_user_data()
    {
        return $this->belongsTo('App\Models\MainDB\UserData', 'participation_user_id', 'user_id');
    }

    public function room()
    {
        return $this->belongsTo('App\Models\MainDB\UserRoom', 'room_id', 'id');
    }
}
